package com.tiantianfresh.model.dao;

import com.tiantianfresh.model.pojo.Categorygrouping;
import com.tiantianfresh.model.pojo.CategorygroupingCommodity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author FANGAO
 * @date 2021/11/24 - 上午 10:39
 */
public interface CategorygroupingMapper extends Mapper<Categorygrouping> {
    /**
     * Categorygrouping,返回list集合
     * @return
     */
    List<Categorygrouping> selectAll();

    /**
     * 增加一个Categorygrouping
     * @param categorygrouping
     * @return
     */
    int addCategorygrouping(Categorygrouping categorygrouping);

    /**
     * 根据id删除一个Categorygrouping
     * @param id
     * @return
     */
    int deleteCategorygroupingById(@Param("id") int id);

    /**
     * 更新Categorygrouping
     * @param categorygrouping
     * @return
     */
    int updateCategorygrouping(Categorygrouping categorygrouping);

    /**
     *  根据id查询Categorygrouping
     * @param id
     * @return
     */
    Categorygrouping queryCategorygroupingById(@Param("id") int id);

    /**
     * 二级菜单
     * @return
     */
    @Select("select * from r_categorygrouping")
    List<CategorygroupingCommodity> queryCategorygroupingCommodity();
}
